package pl.edu.agh.mobilne.dev.weight;

import pl.edu.agh.mobilne.dev.weight.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Weight extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button sendResultBt = (Button) findViewById(R.id.sendResult);
        sendResultBt.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent intent = getIntent();
                EditText result = ((EditText) findViewById(R.id.EditText01));
                intent.putExtra("result", result.getText().toString());
                intent.putExtra("measurementName", "weight");
                setResult(1, intent);
                finish();
     		}
        });
        
    }
}